.class public Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;
.super Ljava/lang/Object;
.source "DistanceDrawingState.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/states/map_states/MapState;


# instance fields
.field private data:Llt/noframe/gpsfarmguide/Data;


# direct methods
.method public constructor <init>()V
    .locals 7

    .line 29
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 30
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    .line 31
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton1()Landroid/view/MenuItem;

    move-result-object v0

    const/4 v1, 0x1

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 32
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton1()Landroid/view/MenuItem;

    move-result-object v0

    const v2, 0x7f08016e

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 33
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton2()Landroid/view/MenuItem;

    move-result-object v0

    const/4 v2, 0x0

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 34
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton2()Landroid/view/MenuItem;

    move-result-object v0

    const v3, 0x7f080161

    invoke-interface {v0, v3}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 35
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton3()Landroid/view/MenuItem;

    move-result-object v0

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 36
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton3()Landroid/view/MenuItem;

    move-result-object v0

    const v3, 0x7f08015b

    invoke-interface {v0, v3}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 37
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 38
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getLayersButton()Landroid/view/MenuItem;

    move-result-object v0

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 39
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 41
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v3

    const-wide/high16 v4, 0x4049000000000000L    # 50.0

    invoke-static {v4, v5, v3}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v3

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-virtual {v0, v2, v3, v2, v4}, Lcom/google/android/gms/maps/GoogleMap;->setPadding(IIII)V

    .line 42
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v3

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v4

    const-wide v5, 0x405a400000000000L    # 105.0

    invoke-static {v5, v6, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 43
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object v3

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v4

    const-wide v5, 0x404b800000000000L    # 55.0

    invoke-static {v5, v6, v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 45
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Llt/noframe/gpsfarmguide/views/ActivityDrawer;

    invoke-virtual {v0, v2}, Llt/noframe/gpsfarmguide/views/ActivityDrawer;->setDrawerLocked(Z)V

    return-void
.end method


# virtual methods
.method public button1()V
    .locals 0

    .line 50
    invoke-static {}, Llt/noframe/gpsfarmguide/dialogs/MeasuresDialogs;->endMeasuring()V

    return-void
.end method

.method public button2()V
    .locals 0

    return-void
.end method

.method public button3()V
    .locals 4

    .line 60
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getId()I

    move-result v0

    const/4 v1, 0x1

    if-lez v0, :cond_0

    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-le v0, v1, :cond_0

    .line 61
    invoke-static {}, Llt/noframe/gpsfarmguide/database/DB;->getDB()Llt/noframe/gpsfarmguide/database/DB;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/database/DB;->saveMeasure(Llt/noframe/gpsfarmguide/models/MeasuringModel;)V

    .line 62
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getGui()Llt/noframe/gpsfarmguide/gui/Gui;

    move-result-object v0

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Llt/noframe/gpsfarmguide/gui/Gui;->clearGui(I)V

    .line 63
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/states/map_states/FreeMapState;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/map_states/FreeMapState;-><init>()V

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->setCurrentState(Llt/noframe/gpsfarmguide/states/map_states/MapState;)V

    goto :goto_0

    .line 65
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-le v0, v1, :cond_1

    .line 66
    new-instance v0, Landroid/content/Intent;

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v2

    const-class v3, Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-direct {v0, v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 67
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v2

    check-cast v2, Llt/noframe/gpsfarmguide/views/ActivityDrawer;

    invoke-virtual {v2, v0, v1}, Landroidx/fragment/app/FragmentActivity;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_0

    .line 69
    :cond_1
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Llt/noframe/gpsfarmguide/dialogs/ErrorDialogs;->notEnoughPoints(Landroid/content/Context;)V

    :goto_0
    return-void
.end method

.method public buttonCenter()V
    .locals 3

    .line 82
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-static {v0, v1, v1, v2}, Llt/noframe/gpsfarmguide/LocationTracking;->centerMyPosition(Landroid/content/Context;ZZZ)Z

    return-void
.end method

.method public buttonZoom()V
    .locals 2

    .line 75
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/DistanceDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    .line 76
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_0

    const/4 v1, 0x2

    .line 77
    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/utils/Camera;->showMeasure(Ljava/util/List;I)V

    :cond_0
    return-void
.end method

.method public onBackPressed()V
    .locals 0

    .line 87
    invoke-static {}, Llt/noframe/gpsfarmguide/dialogs/MeasuresDialogs;->endMeasuring()V

    return-void
.end method
